var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
  console.log('a user connected');
  socket.emit('an event', { some: '我也是，学了一整天，都搞不好这个！'})
  socket.on("client",(res)=>{
    console.log(res)
  })
    
});

http.listen(3000, function(){
  console.log('listening on *:3000');
});
    